<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/include/page.jsp"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>品牌列表 - easyui</title>
<%@ include file="/common/include/title.jsp"%>

<script type="text/javascript">
				
				
				function query()
				{
					/* 先将条件放到请求头中 */
					var keyword = $("#keyword").val();
					var status = $("#status").val();
					var st = $("#st").datetimebox("getValue");
					var ed = $("#ed").datetimebox("getValue");
					
					alert(st + "-->" + ed)
					/* 将数据放到请求头传递给后台有两种方法:get,post */
					/* 先取得datagrid的对象 */
					var ops = $("#dataGrid").datagrid("options");
					/* 只能以get方法放到url上面(参数) */
					ops.url = "${rootPath }/back/goods/brandListJSON.htm?keyword=" + keyword + "&status="+status + "&st=" +st + "&ed=" + ed;
					/* 重新刷新表格 */
					$("#dataGrid").datagrid("reload");
					return false ; 
				}
				/* 添加数据 */
				function addData()
				{
					addTabs(window.parent,"管理员添加","insert.html");
					return false ; 
				}
				
				/* 删除数据 */
				function removeData()
				{
					var row = $("#dataGrid").datagrid("getSelected");
					if(row)
					{
						/* 测试数据 */
						var sb = "" ; 
						for(var wangsh in row )
						{
							sb += wangsh + "-->" + row[wangsh] + "\r\n"; 
						}
						alert(sb + '---' + row.title)
						$.messager.confirm("确认","确认要删除吗?",function(data)
						{
							if(data)
							{
								/* 点击确认操作 */
								$.messager.alert("警告框","已经删除")
							}
							return false ; 
						});
					}
					return false ; 
				}
			</script>
</head>
<body>
	<!-- 测试数据 -->
	<table id="dataGrid" class="easyui-datagrid" title="测试数据"
		data-options="
				url:'${rootPath }/back/goods/brandListJSON.htm',
				method:'post',
				border:false,
				singleSelect:true,
				fit:true,
				fitColumn:true,
				collapsible:true,
				rownumbers:true,
				pagination:true,
				toolbar:'#gridToolsbar'">
		<thead>
			<tr>
				<th data-options="field:'ck',checkbox:true"></th>
				<th data-options="field:'count'" width="">序号</th>
				<th data-options="field:'id'" width="80">id</th>
				<th data-options="field:'adminsName'" width="100">管理员</th>
				<th data-options="field:'name'">名称</th>
				<th data-options="field:'website'" width="100">网址</th>
				<th data-options="field:'statusStr'">状态</th>
				<th data-options="field:'createTime'">创建时间</th>
				<th data-options="field:'updateTime'">更新时间</th>
				<th data-options="field:'pubTime'">发布时间</th>

			</tr>
		</thead>
	</table>
	<!-- 表格的工具栏 -->
	<div id="gridToolsbar">
		<div>
			<input id="keyword" name="keyword" class="easyui-textbox"
				placeholder="请输入关键字"> <select id="status" name="status">
				<option value="">请选择</option>
				<option value="1">启用</option>
				<option value="0">禁用</option>
			</select> <input name="st" id="st" value="" class="easyui-datetimebox"
				placeholder="请输入时间" data-options=""> <input name="ed"
				id="ed" value="" class="easyui-datetimebox" placeholder="请输入时间"
				data-options=""> <a href="" onclick="return query()"
				class="easyui-linkbutton" data-options="iconCls:'icon-search'"
				plain="true">搜索</a>
		</div>
		<div>
			<a href="#" class="easyui-linkbutton" title="添加"
				data-options="iconCls:'icon-add'" plain="true"
				onclick="return addData()">添加</a> <a href="#"
				class="easyui-linkbutton" title="更新"
				data-options="iconCls:'icon-edit'" plain="true"
				onclick="return addData()">更新</a> <a href="#"
				class="easyui-linkbutton" title="删除"
				data-options="iconCls:'icon-remove'" plain="true"
				onclick="return removeData()">删除</a>
		</div>
	</div>
</body>
</html>